const fs = require("fs");

// 同步读取
const data = fs.readFileSync("./04_buffer.js");
console.log("data", data.toString());

// fs.readFile("./04_buffer.js", (err, data) => {
//   if (err) throw err;
//   console.log(data.toString());
// })

(async () => {
  const fs = require("fs");
  const { promisify } = require("util");
  const readFile = promisify(fs.readFile);
  const data = await readFile("./04_buffer.js");
  console.log(data.toString());
})();
